function fillStyle(node, style) {
  if(!(node instanceof Node)) {
    console.error(`fill style: node-${node} is not a Node`);
    return;
  }

  if(typeof style !== 'object') {
    console.error(`fill style: style-${style} is not an object`);
    return;
  }

  Object.keys(style).forEach(key => {
    node.style[key] = style[key];
  })
}

function clearStyle(node, keys) {
  if(!(node instanceof Node)) {
    console.error(`clear style: node-${node} is not a Node`);
    return;
  }
  
  if(Array.isArray(keys)) {
    keys.forEach(key => {
      if(typeof key === 'string') {
        node.style[key] = undefined;
      } else {
        console.warn(`clear style: key-${key} is not a string, this will be ignored`);
      }
    })
  } else if(typeof keys === 'string') {
    node.style[keys] = undefined;
  } else {
    console.error(`clear style: unknown key ${keys}`);
  }
}

export {
  fillStyle,
  clearStyle
}